<?php
    require('./Utils.php');

    $post = getJsonParamter();
    $image = $post['image'];
    $type = $post['type'];

    $conn = getConnection();
    $sql = "INSERT INTO pet_type(type, image) VALUES (?, ?)";

    $result = execute($conn, $sql, $type, $image);

    if($result) getJson(200, '添加成功', null);

    else getJson(500, '添加失败', null);
?>